package dli_and_obs.utils

import java.io.ByteArrayInputStream
import java.util.{Properties, UUID}

import scala.util.Random

/**
  * @Description TODO 
  * @Author liutaowei
  * @Date 2019-5-21 12:14
  */
object log_utils {


  def log_writeto_obs(properties:Properties,stream:String,class_name:String)={
    val obsClient = obs_utils.get_obs_client(properties)
    val create_time = properties.getProperty("create_time")
    val bucketname = properties.getProperty("log_bucketname")
    val save_path = properties.getProperty("log_path") +
                    properties.getProperty("user")+"/" +
                    create_time.substring(0,create_time.lastIndexOf("_")) + "/" +
                    create_time + "/" + class_name + ".txt"

    obsClient.putObject(bucketname, save_path
      , new ByteArrayInputStream(stream.getBytes()));

  }


  def get_batch_logs()={

  }
}
